package com.turing.model.caller.client.task.manager;

import com.turing.common.response.ResponseVO;
import com.turing.model.caller.client.BaseClient;
import com.turing.model.caller.client.data.DataClient;
import com.turing.model.caller.vo.in.AnalysisResultVo;
import com.turing.model.caller.vo.in.FileTaskVo;
import com.turing.model.caller.vo.in.OcrPageTask;
import com.turing.model.caller.vo.in.OcrResultVo;
import com.turing.model.caller.vo.out.ForecastVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient( name = "draw")
public interface DrawClient extends BaseClient {

    @Override
    @PostMapping("ocrPageTask/unLockOcrPageTask")
    ResponseVO<Object> unLockOcrPageTask( @RequestParam("ocrPageTaskSn") String ocrPageTaskSn );

    @Override
    @PostMapping("ocrPageTask/getAndLockOcrPageTask")
    ResponseVO<OcrPageTask> getAndLockOcrPageTask( @RequestParam("domain") String domain );

    @Override
    @PostMapping("ocrPageTask/ocrResultCallback")
    public ResponseVO<Object> ocrResultCallback( @RequestBody OcrResultVo ocrResultVo );

    @PostMapping("fileTask/getAndLockForecastTask")
    ResponseVO<FileTaskVo> getAndLockForecastTask( @RequestParam("domain") String domain, @RequestParam("templates") String templates);

    @PostMapping("fileTask/unLockForecastTask")
    ResponseVO<Object> unLockForecastTask( @RequestParam("taskSn") String taskSn );

    @PostMapping("fileTask/forecastResultCallback")
    ResponseVO<Object> forecastResultCallback(@RequestBody Map<String, List<ForecastVO>> forecastEntity , @RequestParam("taskSn") String taskSn,
                                              @RequestParam("parentTaskSn") String parentTaskSn , @RequestParam("templateId") String templateId );

    @PostMapping("fileTask/forecastFailedCallBack")
    ResponseVO<Object> forecastFailedCallBack( @RequestParam("domain") String domain );

    @Override
    @PostMapping("fileTask/getAndLockAnalysisTask")
    ResponseVO<FileTaskVo> getAndLockAnalysisTask( @RequestParam("domain") String domain );

    @Override
    @PostMapping("fileTask/unLockAnalysisTask")
    ResponseVO<Object> unLockAnalysisTask( @RequestParam("taskSn") String taskSn );

    @Override
    @PostMapping("fileTask/analysisCallback")
    ResponseVO<Object> analysisCallback( @RequestBody AnalysisResultVo analysisResultVo );

    @PostMapping("fileTask/getAndLockCurriculumVitaeTask")
    ResponseVO<FileTaskVo> getAndLockCurriculumVitaeTask(@RequestParam("domain") String domain);

    @PostMapping("fileTask/analysisCallback")
    ResponseVO<Object> curriculumVitaeCallback(@RequestBody AnalysisResultVo analysisResultVo);

}
